#pragma once
#include "../Utilities/utilities.h"
#include "Math.h"


class CameraMain
{
private:
	Matrix scale;
	Matrix rotate;
	Matrix translate;
public:
	Vector3 Position;
	Vector3 Target;
	Vector3 Up;
	float Angle;
protected:
	Matrix World;
	Matrix View;
	Matrix Projection;
public:
	CameraMain();

	void Update(ESContext *esContext, GLfloat deltaTime);

	void MoveForward (GLfloat deltaTime, GLfloat speed);
	void MoveBackward (GLfloat deltaTime, GLfloat speed);
	void MoveLeft (GLfloat deltaTime, GLfloat speed);
	void MoveRight (GLfloat deltaTime, GLfloat speed);

	Matrix GetViewMatrix ();
	Matrix GetWorldMatrix ();
};

class Camera
{
private:
	Matrix m_maScale;
	Matrix m_maRotate;
	Matrix m_maTranslate;
	Matrix m_maPerspective;
protected:
	Matrix m_maWorld;
	Matrix m_maView;
	Matrix m_maProjection;
	Vector3 m_vPosition;
	Vector3 m_vTarget;
	Vector3 m_vUp;
public:
	Camera ();
	void SetPosition (Vector3 position);
	void SetTarget (Vector3 target);
	void SetUp (Vector3 up);
	Matrix GetWVPMatrix ();
	Matrix GetInvWVPMatrix ();
	void Update(ESContext *esContext, GLfloat deltaTime);
};